<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>虚拟DOM和真实DOM</title>
    <!-- 引入react核心库 -->
    <script src="./node_modules/react/umd/react.development.js"></script>
    <!-- 引入react-dom 支持react操作dom -->
    <script src="./node_modules/react-dom/umd/react-dom.development.js"></script>
  </head>
  <body>
    <div id="root">真实</div>
  </body>
  <script>
    // 虚拟DOM:
    // 1.本质是Object类型的对象；
    // 2.虚拟DOM比较"轻”,真实DOM比较"重”,因为虚拟DOM是React内部在用,没有真实DOM上那么多的属性；
    // 3.虚拟DOM最终会被React转化为真实DOM,呈现在页面上；
    let div = React.createElement('div', null, '虚拟');
    let root = document.getElementById('root');
    // console.log(div);
    // console.log(root);
    // console.log(typeof div);
    const Arr = [1]

    console.log(div instanceof Object);
    console.log(Arr instanceof Array);
  </script>
</html>
